package com.shura.ssm.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * AbstractController
 * Created by shura
 * Date：2017/9/6
 * Time：15:21
 */
public class AbstractController {

    public final static int AJAX_SUCCESS_CODE = 0;
    public final static int AJAX_FAILED_CODE = 1;

    public static JSON sendMsgAndCode(int code,String msg){
        JSONObject json = new JSONObject();
        json.put("code",code);
        json.put("data",msg);
        return json;
    }

    public static JSON sendCode(int code){
        JSONObject json = new JSONObject();
        json.put("code",code);
        return json;
    }



}
